from genericpath import isdir
import os
os.chdir('instance')

SECRET_KEY = 'flask_devtool'
DATABASE = 'database.sqlite'

# Flask-SQLAlchemy配置
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(os.getcwd(), DATABASE)
SQLALCHEMY_TRACK_MODIFICATIONS = False

basedir = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))     #获取项目根目录

UPLOAD_FOLDER = os.path.join(basedir,'file')    # /root/DevTool/file

if not os.path.isdir(UPLOAD_FOLDER): os.makedirs(UPLOAD_FOLDER)     # 目录不存在则创建
